package com.card.manager.services;

import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.Set;

import org.springframework.security.access.ConfigAttribute;

import com.card.framework.mybatis.optimist.ModifiedByAnotherUserException;
import com.card.framework.page.model.PageModel;
import com.card.manager.domain.Resources;
import com.card.manager.domain.Roles;

public interface RoleService {

	public Map<String, Object> loadAllInfo(); 
	
	public List<Roles> allEnabledList();
	
	public Set<Roles> getUserRoles(int userid);
	
	public Map<String, Object> selectRoleForPage(Roles role,PageModel pageModel);
	
	public void deleteRoles(List<Roles> role) throws ModifiedByAnotherUserException,Exception;
	
	public void addOrUpdate(Roles role);
	
	public void add(Roles role);
	
	public void update(Roles role);
	
	public Roles getById(int id);
	
	public boolean isExistName(String name);
	
	public List<Resources> getRoleResource(int roleid);
	
	public List<Resources> getAllEnableResource();
	
	public void saveRoleResource(int roleid,Integer[] resid);
	
	public Map<String,Collection<ConfigAttribute>> loadResources();
}
